#获取物品信息
import json
from flask import request
from db_client import *

def get_item():
        items =[]
        item_num = request.args.get('search')
        result = mysql_client.get_item(item_num)
        for re in result:
                t = {
                        "id" : re[0],
                        "description" : re[1],
                        "type" : re[2],
                        "name" : re[3]
                }
                items.append(t)
        data = items
        return json.dumps(data,ensure_ascii=False)
        
        